package com.example.birdfriends.service.impl;

import com.example.birdfriends.dao.CommentDao;
import com.example.birdfriends.pojo.comment.Comment;
import com.example.birdfriends.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentDao commentDao = null;

    @Override
    public int addComment(Comment comment) {
        return commentDao.addComment(comment);
    }

    @Override
    public List<Comment> findCommentsByPid(Long pid) {
        return commentDao.findCommentsByPid(pid);  // 查询当前帖子的所有的评论
    }
}
